package com.atstudy.headline.web.app.controller.comment;

import com.atstudy.headline.entity.Comments;
import com.atstudy.headline.result.Result;
import com.atstudy.headline.web.app.service.CommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/app/comment")
public class AppCommentController {

    @Autowired
    private CommentsService commentsService;


    //根据内容id查询评论列表
    @GetMapping("/listByContentId")
    public Result listByContentId(@RequestParam Integer contentId) {
        List<Comments> list = commentsService.listByContentId(contentId);
        return Result.ok(list);
    }




}
